This RMarkdown plots the output of the model fits and simulations

##                mean      se_mean         sd      2.5%       25%       50%
## intercept 4.9584683 0.0023287928 0.06673754 4.8297127 4.9124222 4.9622167
## coef      0.6259157 0.0006562984 0.01817625 0.5937511 0.6130510 0.6254341
## sigma_vl  0.8785846 0.0009118262 0.02529317 0.8304077 0.8610963 0.8787208
## t_dof     8.7199841 0.0591645616 1.67096689 6.2193018 7.5693942 8.4754891
##                 75%      97.5%    n_eff      Rhat
## intercept 5.0029611  5.0854325 821.2562 0.9993502
## coef      0.6381112  0.6619696 767.0189 1.0036362
## sigma_vl  0.8960365  0.9239442 769.4537 0.9997008
## t_dof     9.6492931 12.5993320 797.6500 0.9961905
##                   mean     se_mean         sd      2.5%       25%       50%
## intercept[1] 1.4740669 0.063600951 0.51426658 0.5547103 1.1022390 1.4413228
## intercept[2] 5.5697211 0.004700721 0.09439698 5.3836293 5.5095036 5.5661583
## coef[1]      0.2101603 0.004811855 0.04966600 0.1251691 0.1752057 0.2062638
## coef[2]      1.0539762 0.004750285 0.08053203 0.9250447 0.9975416 1.0441333
## sigma_vl     0.7198390 0.001096484 0.02706600 0.6701177 0.7004831 0.7205154
## t_dof        5.5544309 0.032311247 0.84426185 4.1477745 4.9488136 5.5054319
##                    75%     97.5%     n_eff     Rhat
## intercept[1] 1.8125224 2.5715782  65.38067 1.061172
## intercept[2] 5.6317159 5.7583844 403.26198 1.015138
## coef[1]      0.2421099 0.3164470 106.53524 1.038743
## coef[2]      1.1016846 1.2390020 287.40740 1.022375
## sigma_vl     0.7382902 0.7759451 609.31709 1.002388
## t_dof        6.0392947 7.4199466 682.72670 1.000780
## There are a total of 280 infection episodes
## [1]  2 18
## [1] 8

Time to clearance

There are multiple ways to define time to clearance. We use time to first CT value equal to 40.

Model of viral clearance

Plot data - patients with known vaccination status

## [1] 0.289285

Spline fits

mgcv

Estimated parameters

Figure 1 - model fits

## Warning in predict.gam(mod_gam, data.frame(time = xs, ID = -1), re.effect = NA):
## factor levels -1 not in original fit

Individual fits data 1 - we pick the individuals with the most data

Compute area under the curve

## Doing D max = 5 ....
## Doing D max = 7 ....
## Doing D max = 14 ....

Reduction in AUCs

## Model 1: Wilcoxon test for AUC up to day 5: p= 0.0311334652416703
## Model 2: Wilcoxon test for AUC up to day 5: p= 0.208091724262563
## Model 1: Wilcoxon test for AUC up to day 7: p= 0.0311334652416703
## Model 2: Wilcoxon test for AUC up to day 7: p= 0.163340554379603
## Model 1: Wilcoxon test for AUC up to day 14: p= 0.0242205361668288
## Model 2: Wilcoxon test for AUC up to day 14: p= 0.231141448679665

## 
##  Welch Two Sample t-test
## 
## data:  colMeans(thetas_mod1$theta_rand[, not_vacc_ind, 2]) and colMeans(thetas_mod1$theta_rand[, vacc_ind, 2])
## t = -2.595, df = 32.559, p-value = 0.01407
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.35997143 -0.04348798
## sample estimates:
##   mean of x   mean of y 
## -0.10670573  0.09502397

Variants and vaccines

effect of variant

## 
##             Alpha             Delta           Epsilon                NV 
##                14                50                12                27 
##           Omicron             Other       OtherVOIVOC Suspected Omicron 
##                40               107                 5                25

effect of vaccine

## 
##  0  1 
## 60 17

Sample size estimation

##   effect     power
## 1    1.0 0.0210000
## 2    1.3 0.4908750
## 3    1.5 0.7781875
##   t_design    power
## 1        1 0.676875
## 2        2 0.640750
## 3        3 0.633250
## 4        4 0.587250
## [1] 1000 1000
## 
## 5000 
##   33